package com.ikas.autumn.iec104.module.protocol.entity;

import com.ikas.autumn.iec104.module.protocol.enums.ProtocolEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * 协议配置
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProtocolParam {

    private ProtocolEnum protocolEnum;

    private String ip;
    private String port;

    private Boolean isConnect;

    /**
     * =================104专属=================
     */
    private Integer address;

    private Integer dit;



    /**
     * =================mqtt专属=================
     */
    private String username;
    private String password;
    private String clientId;
    private String topic;
    private Integer qos;

    public ProtocolParam(ProtocolEnum protocolEnum, String ip, String port, Boolean isConnect, String username, String password, String clientId, String topic, Integer qos) {
        this.protocolEnum = protocolEnum;
        this.ip = ip;
        this.port = port;
        this.isConnect = isConnect;
        this.username = username;
        this.password = password;
        this.clientId = clientId;
        this.topic = topic;
        this.qos = qos;
    }

    public ProtocolParam(ProtocolEnum protocolEnum, String ip, String port, Boolean isConnect, String username, String password, String clientId, String topic) {
        this.protocolEnum = protocolEnum;
        this.ip = ip;
        this.port = port;
        this.isConnect = isConnect;
        this.username = username;
        this.password = password;
        this.clientId = clientId;
        this.topic = topic;
    }

    public ProtocolParam(ProtocolEnum protocolEnum, String ip, String port, Boolean isConnect) {
        this.protocolEnum = protocolEnum;
        this.ip = ip;
        this.port = port;
        this.isConnect = isConnect;
    }

    public ProtocolParam(ProtocolEnum protocolEnum, String ip, String port, Boolean isConnect, String username, String password, String clientId) {
        this.protocolEnum = protocolEnum;
        this.ip = ip;
        this.port = port;
        this.isConnect = isConnect;
        this.username = username;
        this.password = password;
        this.clientId = clientId;
    }
}
